.Dd January  3, 2022
.Dt libwrc 3
.Os libwrc
.Sh NAME
.Nm libwrc.h
.Nd Library to access the Windows Resource Compiler (WRC) format
.Sh SYNOPSIS
.In libwrc.h
.Pp
Support functions
.Ft const char *
.Fn libwrc_get_version "void"
.Ft int
.Fn libwrc_get_access_flags_read "void"
.Ft int
.Fn libwrc_get_codepage "int *codepage" "libwrc_error_t **error"
.Ft int
.Fn libwrc_set_codepage "int codepage" "libwrc_error_t **error"
.Pp
Notify functions
.Ft void
.Fn libwrc_notify_set_verbose "int verbose"
.Ft int
.Fn libwrc_notify_set_stream "FILE *stream" "libwrc_error_t **error"
.Ft int
.Fn libwrc_notify_stream_open "const char *filename" "libwrc_error_t **error"
.Ft int
.Fn libwrc_notify_stream_close "libwrc_error_t **error"
.Pp
Error functions
.Ft void
.Fn libwrc_error_free "libwrc_error_t **error"
.Ft int
.Fn libwrc_error_fprint "libwrc_error_t *error" "FILE *stream"
.Ft int
.Fn libwrc_error_sprint "libwrc_error_t *error" "char *string" "size_t size"
.Ft int
.Fn libwrc_error_backtrace_fprint "libwrc_error_t *error" "FILE *stream"
.Ft int
.Fn libwrc_error_backtrace_sprint "libwrc_error_t *error" "char *string" "size_t size"
.Pp
Stream functions
.Ft int
.Fn libwrc_stream_initialize "libwrc_stream_t **stream" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_free "libwrc_stream_t **stream" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_signal_abort "libwrc_stream_t *stream" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_open "libwrc_stream_t *stream" "const char *filename" "int access_flags" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_close "libwrc_stream_t *stream" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_ascii_codepage "libwrc_stream_t *stream" "int *ascii_codepage" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_set_ascii_codepage "libwrc_stream_t *stream" "int ascii_codepage" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_virtual_address "libwrc_stream_t *stream" "uint32_t *virtual_address" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_set_virtual_address "libwrc_stream_t *stream" "uint32_t virtual_address" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_number_of_resources "libwrc_stream_t *stream" "int *number_of_resources" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_resource_by_index "libwrc_stream_t *stream" "int resource_index" "libwrc_resource_t **resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_resource_by_identifier "libwrc_stream_t *stream" "uint32_t identifier" "libwrc_resource_t **resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_resource_by_type "libwrc_stream_t *stream" "int type" "libwrc_resource_t **resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_resource_by_utf8_name "libwrc_stream_t *stream" "const uint8_t *utf8_string" "size_t utf8_string_length" "libwrc_resource_t **resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_stream_get_resource_by_utf16_name "libwrc_stream_t *stream" "const uint16_t *utf16_string" "size_t utf16_string_length" "libwrc_resource_t **resource" "libwrc_error_t **error"
.Pp
Available when compiled with wide character string support:
.Ft int
.Fn libwrc_stream_open_wide "libwrc_stream_t *stream" "const wchar_t *filename" "int access_flags" "libwrc_error_t **error"
.Pp
Available when compiled with libbfio support:
.Ft int
.Fn libwrc_stream_open_file_io_handle "libwrc_stream_t *stream" "libbfio_handle_t *file_io_handle" "int access_flags" "libwrc_error_t **error"
.Pp
Resource functions
.Ft int
.Fn libwrc_resource_free "libwrc_resource_t **resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_identifier "libwrc_resource_t *resource" "uint32_t *identifier" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_utf8_name_size "libwrc_resource_t *resource" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_utf8_name "libwrc_resource_t *resource" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_utf16_name_size "libwrc_resource_t *resource" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_utf16_name "libwrc_resource_t *resource" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_type "libwrc_resource_t *resource" "int *type" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_number_of_items "libwrc_resource_t *resource" "int *number_of_items" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_get_item_by_index "libwrc_resource_t *resource" "int item_index" "libwrc_resource_item_t **resource_item" "libwrc_error_t **error"
.Pp
Resource item functions
.Ft int
.Fn libwrc_resource_item_free "libwrc_resource_item_t **resource_item" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_identifier "libwrc_resource_item_t *resource_item" "uint32_t *identifier" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_utf8_name_size "libwrc_resource_item_t *resource_item" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_utf8_name "libwrc_resource_item_t *resource_item" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_utf16_name_size "libwrc_resource_item_t *resource_item" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_utf16_name "libwrc_resource_item_t *resource_item" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Ft ssize_t
.Fn libwrc_resource_item_read_buffer "libwrc_resource_item_t *resource_item" "uint8_t *buffer" "size_t size" "libwrc_error_t **error"
.Ft off64_t
.Fn libwrc_resource_item_seek_offset "libwrc_resource_item_t *resource_item" "off64_t offset" "int whence" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_offset "libwrc_resource_item_t *resource_item" "off64_t *offset" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_size "libwrc_resource_item_t *resource_item" "uint32_t *size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_number_of_sub_items "libwrc_resource_item_t *resource_item" "int *number_of_sub_items" "libwrc_error_t **error"
.Ft int
.Fn libwrc_resource_item_get_sub_item_by_index "libwrc_resource_item_t *resource_item" "int sub_item_index" "libwrc_resource_item_t **resource_sub_item" "libwrc_error_t **error"
.Pp
Manifest resource functions
.Ft int
.Fn libwrc_manifest_resource_initialize "libwrc_manifest_resource_t **manifest_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_manifest_resource_free "libwrc_manifest_resource_t **manifest_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_manifest_resource_read "libwrc_manifest_resource_t *manifest_resource" "const uint8_t *data" "size_t data_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_manifest_resource_get_utf8_string_size "libwrc_manifest_resource_t *manifest_resource" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_manifest_resource_get_utf8_string "libwrc_manifest_resource_t *manifest_resource" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_manifest_resource_get_utf16_string_size "libwrc_manifest_resource_t *manifest_resource" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_manifest_resource_get_utf16_string "libwrc_manifest_resource_t *manifest_resource" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Pp
Message table (MESSAGETABLE) resource functions
.Ft int
.Fn libwrc_message_table_resource_initialize "libwrc_message_table_resource_t **message_table_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_free "libwrc_message_table_resource_t **message_table_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_read "libwrc_message_table_resource_t *message_table_resource" "const uint8_t *data" "size_t data_size" "int ascii_codepage" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_number_of_messages "libwrc_message_table_resource_t *message_table_resource" "int *number_of_messages" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_identifier "libwrc_message_table_resource_t *message_table_resource" "int message_index" "uint32_t *message_identifier" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_index_by_identifier "libwrc_message_table_resource_t *message_table_resource" "uint32_t message_identifier" "int *message_index" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_utf8_string_size "libwrc_message_table_resource_t *message_table_resource" "int message_index" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_utf8_string "libwrc_message_table_resource_t *message_table_resource" "int message_index" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_utf16_string_size "libwrc_message_table_resource_t *message_table_resource" "int message_index" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_message_table_resource_get_utf16_string "libwrc_message_table_resource_t *message_table_resource" "int message_index" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Pp
MUI resource functions
.Ft int
.Fn libwrc_mui_resource_initialize "libwrc_mui_resource_t **mui_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_free "libwrc_mui_resource_t **mui_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_read "libwrc_mui_resource_t *mui_resource" "const uint8_t *data" "size_t data_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_file_type "libwrc_mui_resource_t *mui_resource" "uint32_t *file_type" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_main_name_size "libwrc_mui_resource_t *mui_resource" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_main_name "libwrc_mui_resource_t *mui_resource" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_main_name_size "libwrc_mui_resource_t *mui_resource" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_main_name "libwrc_mui_resource_t *mui_resource" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_mui_name_size "libwrc_mui_resource_t *mui_resource" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_mui_name "libwrc_mui_resource_t *mui_resource" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_mui_name_size "libwrc_mui_resource_t *mui_resource" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_mui_name "libwrc_mui_resource_t *mui_resource" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_language_size "libwrc_mui_resource_t *mui_resource" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_language "libwrc_mui_resource_t *mui_resource" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_language_size "libwrc_mui_resource_t *mui_resource" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_language "libwrc_mui_resource_t *mui_resource" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_fallback_language_size "libwrc_mui_resource_t *mui_resource" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf8_fallback_language "libwrc_mui_resource_t *mui_resource" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_fallback_language_size "libwrc_mui_resource_t *mui_resource" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_mui_resource_get_utf16_fallback_language "libwrc_mui_resource_t *mui_resource" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Pp
String table (STRINGTABLE) resource functions
.Ft int
.Fn libwrc_string_table_resource_initialize "libwrc_string_table_resource_t **string_table_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_free "libwrc_string_table_resource_t **string_table_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_read "libwrc_string_table_resource_t *string_table_resource" "const uint8_t *data" "size_t data_size" "uint32_t base_identifier" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_number_of_strings "libwrc_string_table_resource_t *string_table_resource" "int *number_of_strings" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_identifier "libwrc_string_table_resource_t *string_table_resource" "int string_index" "uint32_t *string_identifier" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_index_by_identifier "libwrc_string_table_resource_t *string_table_resource" "uint32_t string_identifier" "int *string_index" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_utf8_string_size "libwrc_string_table_resource_t *string_table_resource" "int string_index" "size_t *utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_utf8_string "libwrc_string_table_resource_t *string_table_resource" "int string_index" "uint8_t *utf8_string" "size_t utf8_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_utf16_string_size "libwrc_string_table_resource_t *string_table_resource" "int string_index" "size_t *utf16_string_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_string_table_resource_get_utf16_string "libwrc_string_table_resource_t *string_table_resource" "int string_index" "uint16_t *utf16_string" "size_t utf16_string_size" "libwrc_error_t **error"
.Pp
Version information (VERSIONINFO) resource functions
.Ft int
.Fn libwrc_version_information_resource_initialize "libwrc_version_information_resource_t **version_information_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_version_information_resource_free "libwrc_version_information_resource_t **version_information_resource" "libwrc_error_t **error"
.Ft int
.Fn libwrc_version_information_resource_read "libwrc_version_information_resource_t *version_information_resource" "const uint8_t *data" "size_t data_size" "libwrc_error_t **error"
.Ft int
.Fn libwrc_version_information_resource_get_file_version "libwrc_version_information_resource_t *version_information_resource" "uint64_t *file_version" "libwrc_error_t **error"
.Ft int
.Fn libwrc_version_information_resource_get_product_version "libwrc_version_information_resource_t *version_information_resource" "uint64_t *product_version" "libwrc_error_t **error"
.Sh DESCRIPTION
The
.Fn libwrc_get_version
function is used to retrieve the library version.
.Sh RETURN VALUES
Most of the functions return NULL or \-1 on error, dependent on the return type.
For the actual return values see "libwrc.h".
.Sh ENVIRONMENT
None
.Sh FILES
None
.Sh NOTES
libwrc can be compiled with wide character support (wchar_t).
.sp
To compile libwrc with wide character support use:
.Ar ./configure --enable-wide-character-type=yes
 or define:
.Ar _UNICODE
 or
.Ar UNICODE
 during compilation.
.sp
.Ar LIBWRC_WIDE_CHARACTER_TYPE
 in libwrc/features.h can be used to determine if libwrc was compiled with wide character support.
.Sh BUGS
Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libwrc/issues
.Sh AUTHOR
These man pages are generated from "libwrc.h".
.Sh COPYRIGHT
Copyright (C) 2011-2024, Joachim Metz <joachim.metz@gmail.com>.
.sp
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.Sh SEE ALSO
the libwrc.h include file
